package com.hhs.storage.controller;


import com.github.xiaoymin.knife4j.annotations.ApiSupport;
import com.hhs.storage.bean.InputParam;
import com.hhs.storage.bean.Participle;
import com.hhs.storage.bean.TypeDic;
import com.hhs.storage.service.BaseLogsService;
import com.hhs.storage.service.ParticipleService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.annotations.ApiIgnore;

import javax.annotation.Resource;
import java.util.Map;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author pxx
 * @since 2024-01-24
 */
@RestController
@RequestMapping("/participle")
@ApiSupport(order = 1)      //排序
@Api(tags = "分词")   //
public class ParticipleController {
    @Resource
    private ParticipleService participleService;
    @RequestMapping(value = "table")
    @ApiOperation(value = "获取分词字典",
            notes = "获取分词字典",
            httpMethod = "POST"
    )
    public Map<String, Object> getAll(@ApiIgnore Participle participle,@ApiIgnore InputParam inputParam) {
        return participleService.getAll(participle,inputParam);
    }
    @RequestMapping(value = "add")
    @ApiOperation(value = "新增分词",
            notes = "传入一句话，将会为你自动分词",
            httpMethod = "POST"
    )
    @ApiImplicitParams({
            @ApiImplicitParam(dataTypeClass = String.class,name = "name", value = "string类型",required =
                    true,paramType = "query"),
    })
    public Map<String, Object> add(@ApiIgnore Participle participle, @ApiIgnore InputParam inputParam) {
        return participleService.add(participle,inputParam);
    }
}

